﻿@model Orchard.ContentPicker.ViewModels.ContentPickerFieldViewModel
@using Orchard.ContentPicker.Settings;

@{
    Script.Require("ContentPicker").AtFoot();
    Script.Require("jQueryUI_Sortable").AtFoot();
    Style.Include("content-picker-admin.css");
    
    var settings = Model.Field.PartFieldDefinition.Settings.GetModel<ContentPickerFieldSettings>();
}
@Display.ContentPicker_Edit(
    Required: settings.Required,
    Multiple: settings.Multiple,
    DisplayName: Model.Field.DisplayName,
    IdsFieldId: Html.FieldIdFor(m => m.Field.Ids),
    SelectedItemsFieldName: Html.FieldNameFor(m => m.SelectedIds),
    ContentItems: Model.ContentItems,
    Hint: settings.Hint,
    PartName: Model.Part.PartDefinition.Name,
    FieldName: Model.Field.PartFieldDefinition.Name
)